#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
int main()
{
	int n = 0;
	scanf("%d", &n);

	char ar[105] = { 0 };
	int arr[105] = { 0 };
	char* pch[5];

	int i = 0;
	for (i = 0; i < 5; i++)
	{
		pch[i] = (char*)malloc(32 * sizeof(char));
	}

	pch[0] = "0XXX..XXXXXXXX.XXXXXXXXXXXXXXXX";
	pch[1] = "0X.X..X..X..XX.XX..X....XX.XX.X";
	pch[2] = "0X.X..XXXXXXXXXXXXXXXX..XXXXXXX";
	pch[3] = "0X.X..XX....X..X..XX.X..XX.X..X";
	pch[4] = "0XXX..XXXXXXX..XXXXXXX..XXXXXXX";

	scanf("%s", ar);
	for (i = 0; i < n; i++)
	{
		arr[i] = ar[i] - '0';
	}
	int j = 0;
	for (j = 0; j < 5; j++)
	{
		for (i = 0; i < n; i++)
		{
			int x = 1;
			for (x = 1; x <= 3; x++)
			{
				printf("%c", pch[j][3 * arr[i] + x]);
			}
			if (i != n - 1)
				printf(".");
		}
		printf("\n");

	}
	return 0;
}